package com.yzs.core.repository

import androidx.lifecycle.MutableLiveData
import com.yzs.core.base.BaseRepository
import com.yzs.core.bean.NetworkViewState
import kotlinx.coroutines.CoroutineScope

/**
 *    author : yzs
 *    date   : 2022/1/1214:29
 *    desc   : 测试 repo
 */
class DemoRepo(
    coroutineScope: CoroutineScope,
    viewStates: MutableLiveData<NetworkViewState>
) : BaseRepository(coroutineScope,viewStates) {

    fun getData(liveData: MutableLiveData<String>) {
        launch(block = {
            api.get("s?ie=UTF-8&wd=minifyReleaseWithR8", mutableMapOf())
                .toBean<String>(String::class.java)
        }, success = {
            liveData.value = it
        })
    }
}